﻿CREATE TABLE [User]([Name] NVARCHAR (10),[PassWord] NVARCHAR(10) )
CREATE TABLE KeyWord ([Name] NVARCHAR (10),Used INT)
ALTER TABLE [User]
ADD InvitedBy INT
ALTER TABLE [User]
ALTER COLUMN InvitedBy NVARCHAR(10)
ALTER TABLE [User] DROP COLUMN InvitedBy
backup database [19bang] TO DISK='D:\\19bang.bak'
create database [19bang]
drop database [19bang]
restore database [19bang] from DISK='D:\19bang.bak'
CREATE TABLE Problem 
(ID INT NOT NULL,
Title NVARCHAR(30),
Content NTEXT,
NeedRemoteHeip BIT,
Reward INT,
PublishDateTime DATETIME
)
CREATE TABLE [dbo].[User] (
    [Id]       INT           NOT NULL,
    [Password] NVARCHAR (10) NULL,
    [UserName] NVARCHAR (10) NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC),
    UNIQUE NONCLUSTERED ([UserName] ASC)
);

INSERT [User] VALUES(1, N'17bang',N'1234')
INSERT [User] VALUES(2, N'Admin',null)



BEGIN TRANSACTION        -- 开始事务
UPDATE Problem SET Reward=0
COMMIT TRANSACTION       -- 提交事务